-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tikv: fix switch region leader to TiFlash when TiFlash return EpochNotMatch #17931
Conversation
/run-unit-test |
LGTM |
Codecov Report
@@ Coverage Diff @@
## master #17931 +/- ##
================================================
- Coverage 79.5042% 79.4475% -0.0568%
================================================
Files 524 524
Lines 142449 141939 -510
================================================
- Hits 113253 112767 -486
+ Misses 20070 20037 -33
- Partials 9126 9135 +9 |
/rebuild |
/run-unit-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
/run-all-tests |
@lysu merge failed. |
@coocood @jackysp at last commit 5bfecf5#diff-708f6242b27e2b7bcf0e905e9b0eacf2R530%EF%BC%8C this PR add mechanism to let wrong request (e.g. leader send to tiflash) can be retry to right store(e.g. retry it to tikv)
to fix the unknown situation in future that lead request stuck.. |
@@ -522,7 +527,7 @@ func (c *RegionCache) OnSendFail(bo *Backoffer, ctx *RPCContext, scheduleReload | |||
} | |||
|
|||
// try next peer to found new leader. | |||
if ctx.Store.storeType == kv.TiKV { | |||
if ctx.ReqStoreType == kv.TiKV { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear what's the difference between ReqStoreType and Store.storeType.
replace this with #18040, and this became a hotfix backup pr - - |
What problem does this PR solve?
Issue Number: close #17930
Problem Summary:
see detail in issue
What is changed and how it works?
What's Changed, How it Works:
we cannot get leader info from epochNotMatchError, but we can choose any tikv store peer as leader.
region cache find leader with one NotLeader resp from any tikv peer.
Related changes
Check List
Tests
Side effects
Release note
This change is